import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * ClassName: SortAndDeduplicate
 * Package: PACKAGE_NAME
 *
 * @Author 马学兴
 * @Create 2025-02-13 14:04
 * @Version 1.0
 * Description:
 */
public class SortAndDeduplicate {
    public static void main(String[] args) {
        int array[] = {1, 8, 5, 2, 4, 9, 7, 2, 5, 7, 7, 9};
        List<Integer> collect = Arrays.stream(array)
                .boxed()//将基本数据类型的流转换为对象类型的流
                .distinct()//去重
                .sorted((a, b) -> b - a).collect(Collectors.toList());//降序排序
        System.out.println(collect);
    }
}
